home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8835 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  39 lines

  1. Newsgroups: comp.lang.c++,comp.os.msdos.programmer
  2. Path: actrix.gen.nz!kheidens
  3. From: kheidens@atlantis.actrix.gen.nz (Kris Heidenstrom)
  4. Subject: Re: Timer (0x1C) Interrupt exactly 18.2 seconds?
  5. Message-ID: <DnEMuF.DEK@actrix.gen.nz>
  6. Sender: news@actrix.gen.nz (News Administrator)
  7. Organization: Actrix - Internet Services
  8. Date: Mon, 26 Feb 1996 22:37:26 GMT
  9. References: <4givrv$cim@midland.co.nz> <Dn9FMB.19s.0.sheppard@torfree.net> <4gr0bt$qck@masala.cc.uh.edu>
  10. X-Nntp-Posting-Host: atlantis.actrix.gen.nz
  11.  
  12. In article <4gr0bt$qck@masala.cc.uh.edu>,
  13. Sensarn <txs53132@bayou.uh.edu> wrote:
  14. > Try this:
  15. > outp(0x43,0x40);
  16. > outp(0x3c,0x0b);
  17. > outp(0x3c,0xe9);
  18. > The timer now ticks 20 times a second.
  19.  
  20. Believe it...  or not!
  21.  
  22. At least you have the divisor right.  The correct sequence would be:
  23.  
  24. disable();
  25. outp(0x43, 0x36);        /* or 0x34 instead of 0x36 for mode 2 */
  26. outp(0x40, 0x0B);        /* Loword of divisor */
  27. outp(0x40, 0xE9);        /* Hiword of divisor */
  28. enable();
  29.  
  30. But of course speeding up the tick without intercepting int 8
  31. will cause the DOS time to run fast.
  32.  
  33. Kris
  34. -- 
  35. Kris Heidenstrom    kheidens@actrix.gen.nz    Wellington, NZ
  36.    "Silly Pate - Tastes great...  Bounces high!"  - AWotM
  37.